<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        new Promise((resolve,reject)=>{
            console.log('开始请求a数据');
            try{
                setTimeout(() => {
                    console.log('请求a数据成功');
                    //模拟请求回来的数据
                    const name ={
                        name : 'lisei'
                    }
                    resolve(name)
                },2000);
            }catch(e){
                reject(e.message)
            }
        })
        .then(value=>{
            return new Promise((resolve,reject)=>{
                console.log('开始请求b数据');
                try{
                setTimeout(() => {
                    console.log('请求b数据成功');
                    //模拟请求回来的数据
                    const age ={
                        age : 19
                    }
                resolve({
                    ...value,
                    ...age
                })
                },2000);
            }catch(e){
                reject(e.message)
            }
            })
        })
        .then(value=>{
            return new Promise((resolve,reject)=>{
                console.log('开始请求c数据');
                try{
                setTimeout(() => {
                    console.log('请求c数据成功');
                    //模拟请求回来的数据
                    const sex ={
                        sex : '男'
                    }
                resolve({
                    ...value,
                    ...sex
                })
                },2000);
            }catch(e){
                reject(e.message)
            }
            })
        })
        .then(value => {
        //处理value
        console.log(value);
      })
      .catch(reason=>{
        console.log('错啦');
      })
    </script>
</body>
</html>